<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <img id="h1" src="E:\JavaWeb\JS\off.png"> <br><br>

    <div class="class">IT教育</div> <br>
    <div class="class">我爱编程</div> <br>

    <input type="checkbox" name="hobby"> 电影
    <input type="checkbox" name="hobby"> 旅游
    <input type="checkbox" name="hobby"> 游戏
</body>
<script>
    //1.点亮灯泡：src属性值
    var img = document.getElementById("h1");
    img.src = "E:\JavaWeb\JS\on.png";

    //2.将所有div标签的内容后面加上：very good
    var divs = document.getElementsByTagName("div");
    for (var i = 0; i < divs.length; i++) {
        const div = divs[i];
        div.innerHTML = div.innerHTML + " very good";
    }

    //3.将所有的复选框呈现选中状态
    var ins = document.getElementsByName("hobby");
    for (var i = 0; i < ins.length; i++) {
        const in1 = ins[i];
        in1.checked = true;
    }
</script>
</html>